package lumis.portal.fileparser;

//import it.sauronsoftware.jave.Encoder;
//import it.sauronsoftware.jave.MultimediaInfo;

import java.io.File;

import lumis.portal.PortalException;
//import lumis.portal.UnexpectedException;

/**
 * Parses a file using FFMPEG.
 * 
 * @version $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
 * @since 6.0.0
 */
class FFMPEGFileParser implements IFileParser
{

	/**
	 * Extracts the metadata of a file using FFMPEG.
	 * @param file The file to be parsed.
	 * @param contentType The type of the content of the file.
	 * @param metadata The metadata already extracted.
	 * @throws PortalException If any error occurs extracting the metadata.
	 * @since 6.0.0
	 */
	public void extractMetadata(File file, String contentType, FileMetadata metadata) throws PortalException
	{
		/*
		try
		{
			contentType = contentType.toLowerCase();

			boolean isVideo = contentType.startsWith("video");

			if (isVideo)
			{
				Encoder encoder = new Encoder();
				MultimediaInfo info = encoder.getInfo(file);
				metadata.setFormat(info.getFormat());

				// Even if its an image, the size is retrieved
				if (info.getVideo() != null && info.getVideo().getSize() != null)
				{
					metadata.setHeight(info.getVideo().getSize().getHeight());
					metadata.setWidth(info.getVideo().getSize().getWidth());

					if (isVideo)
					{
						metadata.setDuration(info.getDuration());
					}
				}
			}
		}
		catch (Exception e)
		{
			throw new UnexpectedException(e);
		}
		*/
	}

}
